<div class="editable-field" ...attributes {{did-insert this.captureElement}}>
  {{#if (and this.editing (not @loading))}}
    <div {{on "keydown" this.preventNewlines}} {{on "keyup" this.cancel}}>
      {{yield (hash value=@value update=this.update) to="editing"}}
    </div>
  {{else}}
    {{#if @loading}}
      <FlightIcon @name="loading" class="loading-indicator" />
    {{/if}}
    <button
      class="field-toggle {{if @loading 'loading'}}"
      disabled={{or @disabled @loading}}
      {{on "click" this.edit}}
    >
      {{yield}}
    </button>
  {{/if}}
</div>
